package online.lmds.sdmanage.common;

/**
 * Created by Brighten Ma on 2017/4/11.
 * 状态码
 */
public enum Status {

    SUCCEED(200, "成功"),

    UNKNOW(0,"未知错误"),

    SERVICER_ERROR(10001,"服务端异常"),

    BASE_NEED_LOGIN(10011, "请先登录"),

    BASE_ID_ERROR(10012, "无效的id"),

    BASE_UID_ERROR(10013, "无效的uid"),

    BASE_USER_ID_ERROR(10013, "无效用户id"),

    REG_NAME_ERROR(12010, "用户名只能为字母数字组合，且以字母开头"),

    REG_NAME_REPEAT(12011, "用户名已存在"),

    AUTH_TOKEN_REEOR(12015, "token 不正确"),

    AUTH_TOKEN_EXPIRED(12016, "token 已过期"),

    AUTH_TOKEN_UPDATE_ERROR(12016, "token更新失败"),

    AUTH_USER_PASSWORD_ERROR(12016, "用户名或密码错误"),

    FORMAT_PHOE_ERROR(12018, "输入的手机号格式有误"),

    FORMAT_PASSWORD_ERROR(12019, "密码6-15位置"),

    FORMAT_GENDER_ERROR(12019, "性别格式不正确"),
    FORMAT_EMAIL_ERROR(12019, "邮箱格式不正确"),
    FORMAT_NICK_ERROR(12019, "昵称格式不正确"),

    USER_UPDETE_ERROR(13001,"更新用户资料失败"),
    UPLOAD_NO_FILE(12019, "无效的文件大小"),
    UPLOAD_FILE_TYPE_ERR(12019, "无效的文件类型"),
    UPLOAD_SAVE_FAIL(12019, "保存文件失败"),
    BASE_FILE_PATH_ERR(12019, "无效的图片URL"),

    ;



    public final int value;
    public String msg;


     Status(int value, String msg) {
        this.value = value;
        this.msg = msg;
    }



    public static Status getUnknow(String msg){
         UNKNOW.msg = msg;
         return UNKNOW;
    }

    @Override
    public String toString() {
        return msg;
    }
}
